<template>
  <readonly-form :fields="dataFields.data" :data="data" />
</template>

<script>
import { reactive } from "vue";
import { handleFormEmptyData } from "@/tools/filters";
import { useI18n } from "vue-i18n";

export default {
  props: {
    data: {
      type: Object,
      default: () => ({}),
    },
  },
  setup(props, content) {
    const { t } = useI18n();
    const dataFields = reactive({
      data: [
        {
          title: t('label.detail'),
          fields: [
            { span: 24, title: t('activityManage.label.activityIntroduction'), field: "comment" },
            { span: 6, title: t('activityManage.label.activityBudget'), field: "buggetMoney" },
            { span: 6, title: t('activityManage.label.estimatedContractAmount'), field: "signMoney" },
            { span: 6, title: t('activityManage.label.activityType'), field: "actType" },
            { span: 6, title: t('activityManage.label.whetherToSettleTheSalaryForTheCampusAmbassador'), field: "isSetmoney" },
            { span: 12, title: t('activityManage.label.channel'), field: "channels" },
            { span: 12, title: t('activityManage.label.active-7'), field: "school" },
            { span: 6, title: t('activityManage.label.drainageDestination'), field: "ylBurn" },
            { span: 18, title: t('activityManage.label.sale'), field: "channelsSales" },
          ],
        },
        {
          title: t('activityManage.label.contractDetails'),
          fields: "contractDetails",
          type: "array",
          childFields: [
            { span: 18, title: t('activityManage.label.requirement'), field: "demand" },
            {
              span: 6,
              title: t('activityManage.label.state'),
              field: "contractStatus",
              // event: (record) => {
              //   console.log(record);
              // },
              eventTitle: t('activityManage.label.active-8'),
            },
            { span: 24, title: t('activityManage.label.active-9'), field: "remark" },
            { span: 6, title: t('activityManage.label.active-10'), field: "tagPeople" },
            { span: 6, title: t('activityManage.label.active-11'), field: "tagTime" },
          ],
        },
        {
          title: t('activityManage.label.attachmentInformation'),
          fields: [
            { span: 24, title: t('activityManage.label.contract'), field: "contractName" },
            { span: 24, title: t('activityManage.label.otherFile'), field: "accessoryName" },
          ],
        },
      ],
    });

    return {
      t,
      dataFields,
      handleFormEmptyData,
    };
  },
};
</script>
